﻿<style>
    #container {
        background-color: white;
    }

    .tagSpan {
        padding: 2px;
        background-color: #FF5722;
        color: #fff;
        display: inline-block;
        font-size: 12px;
        margin-left: 3px;
        border-radius: 2px;
    }

    usr-title {
        font-family: georgia;
        color: #d04a12;
        font-style: italic;
        font-size: 1.2rem;
    }

    .search-tab-title {
        font-size: 1.2rem;
        font-style: italic;
        font-family: Georgia;
    }

    .badge {
        display: inline-block;
        padding: .25em .4em;
        font-size: 75%;
        font-weight: 700;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
        vertical-align: baseline;
        border-radius: .25rem;
    }

    .badge-secondary {
        color: #fff;
        background-color: #868e96;
    }

    .btn-pwc {
        background-color: #E0301D;
        color: #fff;
        padding: .175rem .5rem;
        margin-bottom: 5px;
    }

    .fa {
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
    }

    .btn-group-vertical {
        -ms-flex-direction: column;
        flex-direction: column;
        -ms-flex-align: start;
        align-items: flex-start;
        -ms-flex-pack: center;
        justify-content: center;
    }

    body {
        overflow-y: auto;
    }

    #footer {
        position: static;
    }

    .DMS_left {
        width: 250px;
    }

    .DMS_main {
        width: calc(100% - 660px);
        background: #fff;
        padding: 30px 15px;
    }

    .DMS_right {
        width: 400px;
    }

    .DMS_conter {
        display: flex;
        justify-content: space-around;
    }

    .btn-group-vertical > .btn {
        width: 100px;
        min-width: 100px;
    }

    .DMS_main_img {
        width: 140px;
    }

    .DMS_main_btn {
        margin-left: 15px;
    }

    .DMS_main_m {
        width: calc(100% - 230px);
        display: flex;
        justify-content: space-between;
    }

        .DMS_main_m ul.nav li h4 {
            font-size: 21px;
            font-family: Georgia, sans-serif;
        }

    .DMS_main_flex {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    .DMS_banner_top {
        background-image: url("/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=61d4e973-860e-481b-bc49-bf499d8dc159");
        background-size: cover;
        background-repeat: no-repeat;
        width: 100%;
        height: 100px;
        background-position: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .container-fluid {
        padding: 0;
        background: #F0F0F0;
    }

    .DMS_btn_Search {
        background: #D04A02;
        height: 40px;
        color: #fff;
        font-size: 13px;
    }

    .DMS_input_Search {
        height: 40px;
        width: 450px;
        margin-right: 15px;
        padding: 0 5px;
    }

    .DMS_left ul {
        padding: 0;
        margin: 0;
    }

        .DMS_left ul li ul.nav li {
            background: #fff;
            margin: 5px 0 5px 30px;
            padding: 2px 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

    .DMS_left_text {
        height: 40px;
        display: flex;
        justify-content: space-between;
        background: #fff;
        align-items: center;
    }

        .DMS_left_text p {
            font-size: 16px;
            margin: 0 15px;
        }

    .DMS_left .badge-secondary {
        border-radius: 3px;
        background: #EB8C00;
        margin-right: 15px;
        font-size: 18px !important;
    }

    .DMS_m_subitem {
        display: flex;
    }

    .DMS_subitem {
        color: #7D7D7D;
        font-size: 14px;
        word-break: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        width: 108px;
        display: block;
        float: left;
    }

    .DMS_m_subitem input {
        float: left;
    }

    .DMS_left ul li ul.nav li .badge-secondary {
        background: #707070 !important;
        margin: 5px 0 5px 30px;
        padding: 5px 15px;
        font-size: 14px !important;
    }

    .DMS_btn_1 {
        border: #E0301E 1px solid;
        background: #fff;
        color: #E0301E;
    }

    .DMS_main_Do_ul ul {
        list-style: none;
        margin: 0;
        padding: 0;
        margin-right: 30px;
    }

        .DMS_main_Do_ul ul li {
            font-size: 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

            .DMS_main_Do_ul ul li span {
                width: 130px;
                display: block;
            }

    .DMS_Grant {
        display: flex !important;
        font-size: 14px;
        color: #707070;
    }

        .DMS_Grant p {
            font-weight: bold;
            width: 300px;
        }

    .DMS_add_btn {
        border-radius: 50%;
        background: #E0301E;
        cursor: pointer;
        height: 40px;
        width: 40px;
        float: right;
        color: #fff;
        font-size: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .no-data {
        border: 2px dashed #dedede;
        margin: 0 15px;
        background: #fff;
    }

        .no-data .content {
            padding: 20px 30px;
        }

    .progress-bar {
        background-color: #e0301e;
    }
</style>

<div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
    <div style="width: 200px;height:20px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
        <div class="progress progress-striped active" style="margin-bottom: 0;">
            <div class="progress-bar" style="width: 100%;"></div>
        </div>
        <h5 id="loadText">loading...</h5>
    </div>
</div>
<div id="vue_det" class="container-fluid">
    <div class=" DMS_banner_top">
        <input type="text" v-model="searchKey" class="DMS_input_Search" value="Search Document…" />
        <input type="button" class="btn btn-primary DMS_btn_Search" value="Search" v-on:click="likeSearch" />
    </div>
    <div class="DMS_conter">
        <div class="DMS_left" id="mainFilter">
            <ul>
                <li v-for="item in statisticResultList">
                    <div class="DMS_left_text">
                        <p>{{item.DisplayName}}</p>
                        <span class="badge badge-secondary">{{item.Count}}</span>
                    </div>
                    <ul class="nav">
                        <li v-for="subitem in item.Mapping">
                            <div class="DMS_m_subitem">
                                <input type="checkbox" v-on:click="filterSearch(subitem)" name="checkbox" />
                                <span class="DMS_subitem">{{subitem.Value}}</span>
                            </div>
                            <span class="badge badge-secondary">{{subitem.Count}}</span>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="DMS_main" id="mainContent">
            <div class="row" style="display:none;">
                <ul class="list-inline">
                    <li v-for="item in filterList">{{item.ESName}}>>{{item.Value}}</li>
                </ul>
            </div>
            <ul id="myTab" class="nav nav-tabs">
                <li class="active">
                    <a href="#published" data-toggle="tab">
                        <span class="search-tab-title">Published</span>
                        <span class="badge badge-secondary">{{publishedCount}}</span>
                    </a>
                </li>
                <li>
                    <a href="#expired" data-toggle="tab">
                        <span class="search-tab-title">Expired</span>
                        <span class="badge badge-secondary">{{expiredCount}}</span>
                    </a>
                </li>
                <li>
                    <a href="#deleted" data-toggle="tab">
                        <span class="search-tab-title">Recently Deleted</span>
                        <span class="badge badge-secondary">{{deletedCount}}</span>
                    </a>
                </li>
                <div class="DMS_add_btn"><a href="/pwccnhk/gtsventure/vForm/Document/Add" target="_blank" style="color:white;">+</a></div>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="published">
                    <table class="table">
                        <tr v-for="item in dataPublishedResultList">
                            <td>
                                <div class=" DMS_main_flex">
                                    <div class="DMS_main_img">
                                        <img v-if="item.UploadMethod=='Multiple'" src="/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=abd85fde-38ef-4997-9a7d-873dcb6bfe29" width="120" height="120" />
                                        <img v-else v-bind:src="JSON.parse(item.DocumentFile)[0].imgSrc" />
                                    </div>
                                    <div class="DMS_main_m">
                                        <ul class="nav">
                                            <li>
                                                <h4 class="usr-title">{{item.Title}}</h4>
                                            </li>
                                            <li class="DMS_Grant">
                                                <p>{{item.DocumentType}}</p><span>{{item.DocumentSize}}</span>
                                            </li>
                                        </ul>
                                        <div class="DMS_main_Do_ul">
                                            <ul>
                                                <li><span>Document Owner(s)：</span>{{item.DocumentOwner}}</li>
                                                <li><span>Version：</span>{{item.VersionNum}}</li>
                                                <li><span>Creation Date：</span>{{item.CreateDate}}</li>
                                                <li><span>Modify Date：</span>{{item.ModifyDate}}</li>
                                            </ul>

                                        </div>
                                    </div>
                                    <div class="DMS_main_btn">
                                        <div role="group" aria-label="Basic example" class="btn-group-vertical">
                                            <a class="btn DMS_btn_1" v-bind:href="item.NoNotesExternalSourceURL" target="_blank">
                                                <!--<span class="glyphicon glyphicon-eye-open"></span>-->
                                                Preview
                                            </a>
                                            <a class="btn DMS_btn_1" v-if="item.UploadMethod=='Single'" v-bind:href="JSON.parse(item.DocumentFile)[0].fileDownloadurl">
                                                <!--<span class="glyphicon glyphicon-download-alt"></span>-->
                                                Download
                                            </a>
                                            <div class="dropdown btn DMS_btn_1" v-if="item.UploadMethod=='Multiple'">
                                                <button type="button" id="dropdownMenu1" data-toggle="dropdown" style="background:none; border:none">
                                                    <!-- <span class="glyphicon glyphicon-download-alt"></span>
                                                    -->
                                                    Download<span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                                                    <li role="presentation" v-for="fileitem in JSON.parse(item.DocumentMutipleFile)">
                                                        <a role="menuitem" tabindex="-1" v-bind:href="fileitem.fileDownloadurl">{{fileitem.fileName}}</a>
                                                    </li>
                                                </ul>
                                            </div>
                                            <a class="btn DMS_btn_1" v-on:click="recordEdit(item)">
                                                <!-- <span class="glyphicon glyphicon-pencil"></span>-->
                                                Edit
                                            </a>
                                            <a class="btn DMS_btn_1" v-on:click="recordDelete(item)" v-if="staffCode==item.CreateById">
                                                Delete
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr style="text-align:center;" v-if="publishedCount>dataPublishedResultList.length">
                            <td v-on:click="showMoreFilter('Published')"><a class="btn btn-primary">Show more</a></td>
                        </tr>
                    </table>
                </div>
                <div class="tab-pane fade" id="expired">
                    <table class="table">
                        <tr v-for="item in dataExpiredResultList">
                            <td>
                                <div class=" DMS_main_flex">
                                    <div class="DMS_main_img">
                                        <img v-if="item.UploadMethod=='Multiple'" src="/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=abd85fde-38ef-4997-9a7d-873dcb6bfe29" width="120" height="120" />
                                        <img v-else v-bind:src="JSON.parse(item.DocumentFile)[0].imgSrc" />
                                    </div>
                                    <div class="DMS_main_m">
                                        <ul class="nav">
                                            <li>
                                                <h4 class="usr-title">{{item.Title}}</h4>
                                            </li>
                                            <li class="DMS_Grant">
                                                <p>{{item.DocumentType}}</p><span>{{item.DocumentSize}}</span>
                                            </li>
                                        </ul>
                                        <div class="DMS_main_Do_ul">
                                            <ul>
                                                <li><span>Document Owner(s)：</span>{{item.DocumentOwner}}</li>
                                                <li><span>Version：</span>{{item.VersionNum}}</li>
                                                <li><span>Creation Date：</span>{{item.CreateDate}}</li>
                                                <li><span>Modify Date：</span>{{item.ModifyDate}}</li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="DMS_main_btn">
                                        <div role="group" aria-label="Basic example" class="btn-group-vertical">
                                            <a class="btn DMS_btn_1" v-bind:href="item.NoNotesExternalSourceURL" target="_blank">
                                                <!--<span class="glyphicon glyphicon-eye-open"></span>-->
                                                Preview
                                            </a>
                                            <a class="btn DMS_btn_1" v-if="item.UploadMethod=='Single'" v-bind:href="JSON.parse(item.DocumentFile)[0].fileDownloadurl">
                                                <!--<span class="glyphicon glyphicon-download-alt"></span>-->
                                                Download
                                            </a>
                                            <div class="dropdown btn DMS_btn_1" v-if="item.UploadMethod=='Multiple'">
                                                <button type="button" id="dropdownMenu2" data-toggle="dropdown" style="background:none; border:none">
                                                    <!-- <span class="glyphicon glyphicon-download-alt"></span>
                                                    -->
                                                    Download<span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2">
                                                    <li role="presentation" v-for="fileitem in JSON.parse(item.DocumentMutipleFile)">
                                                        <a role="menuitem" tabindex="-1" v-bind:href="fileitem.fileDownloadurl">{{fileitem.fileName}}</a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr style="text-align:center;" v-if="expiredCount>dataExpiredResultList.length">
                            <td v-on:click="showMoreFilter('Expired')"><a class="btn btn-primary">Show more</a></td>
                        </tr>
                    </table>
                </div>
                <div class="tab-pane fade" id="deleted">
                    <table class="table">
                        <tr v-for="item in dataDeletedResultList">
                            <td>
                                <div class=" DMS_main_flex">
                                    <div class="DMS_main_img">
                                        <img v-if="item.UploadMethod=='Multiple'" src="/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=abd85fde-38ef-4997-9a7d-873dcb6bfe29" width="120" height="120" />
                                        <img v-else v-bind:src="JSON.parse(item.DocumentFile)[0].imgSrc" />
                                    </div>
                                    <div class="DMS_main_m">
                                        <ul class="nav">
                                            <li>
                                                <h4 class="usr-title">{{item.Title}}</h4>
                                            </li>
                                            <li class="DMS_Grant">
                                                <p>{{item.DocumentType}}</p><span>{{item.DocumentSize}}</span>
                                            </li>

                                        </ul>
                                        <div class="DMS_main_Do_ul">
                                            <ul>
                                                <li><span>Document Owner(s)：</span>{{item.DocumentOwner}}</li>
                                                <li><span>Version：</span>{{item.VersionNum}}</li>
                                                <li><span>Creation Date：</span>{{item.CreateDate}}</li>
                                                <li><span>Modify Date：</span>{{item.ModifyDate}}</li>
                                            </ul>
                                        </div>

                                        </ul>
                                    </div>
                                    <div class="DMS_main_btn">
                                        <div role="group" aria-label="Basic example" class="btn-group-vertical">
                                            <a class="btn DMS_btn_1" v-bind:href="item.NoNotesExternalSourceURL" target="_blank">
                                                <!--<span class="glyphicon glyphicon-eye-open"></span>-->
                                                Preview
                                            </a>
                                            <a class="btn DMS_btn_1" v-if="item.UploadMethod=='Single'" v-bind:href="JSON.parse(item.DocumentFile)[0].fileDownloadurl">
                                                <!-- <span class="glyphicon glyphicon-download-alt"></span>-->
                                                Download
                                            </a>
                                            <div class="dropdown btn DMS_btn_1" v-if="item.UploadMethod=='Multiple'">
                                                <button type="button" id="dropdownMenu3" data-toggle="dropdown" style="background:none; border:none">
                                                    <!-- <span class="glyphicon glyphicon-download-alt"></span>
                                                    -->
                                                    Download<span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu3">
                                                    <li role="presentation" v-for="fileitem in JSON.parse(item.DocumentMutipleFile)">
                                                        <a role="menuitem" tabindex="-1" v-bind:href="fileitem.fileDownloadurl">{{fileitem.fileName}}</a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr style="text-align:center;" v-if="deletedCount>dataDeletedResultList.length">
                            <td v-on:click="showMoreFilter('Deleted')"><a class="btn btn-primary">Show more</a></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="DMS_right">
            <h4>
                <span style="color:black;">My checkout content</span>
                <span class="badge badge-secondary">{{myCheckOutCount}}</span>
            </h4>
            <div class="no-data" v-if="myCheckOutCount==0">
                <div class="content">
                    <img src="/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=c8d82c1e-e5b1-41e0-97b2-a864c3fd1188">
                    <h6>The content you’ve checked out will list here</h6>
                    <p>If you want to make changes to a content and you want to make sure no one else can edit it, check out the content. When you finish editing and check in the content into the system, other people can see your changes and edit the content, if they have permission.</p>
                </div>
            </div>
            <table class="table" v-else>
                <tr v-for="item in dataMyCheckoutList">
                    <td><img v-bind:src="getDocumentIcon(item.DocumentType)" height="30" width="30" /></td>
                    <td><a v-bind:href="'/pwccnhk/gtsventure/vForm/Document/Edit/'+item._id" target="_blank">{{item.Title}}</a></td>
                </tr>
                <tr style="text-align:center;" v-if="myCheckOutCount>dataMyCheckoutList.length">
                    <td colspan="2"><a class="btn btn-primary" v-on:click="showMoreCheckOut">Show more</a></td>
                </tr>
            </table>
        </div>
    </div>
</div>


<script src="/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=fb2e3700-1f29-4611-889b-5ce7c18cb955"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#vue_det',
        data: {
            searchKey: "",
            t: "All",
            q: "",
            f: "",
            s: "",
            p: 1,
            requrl: "https://appcnhkdm450.digitalmaker.asia.pwcinternal.com/pwccnhk/gtsventure/Admin/Home/ESSearchResultByType",
            statisticResultList: [],
            dataPublishedResultList: [],
            dataExpiredResultList: [],
            dataDeletedResultList: [],
            publishedCount: 0,
            expiredCount: 0,
            deletedCount: 0,
            filterList: [],
            filterShow: true,
            staffCode: CustomCodeResultData.CurrentUser.UserInfo.StaffCode,
            dataMyCheckoutList: [],
            myCheckOutCount: 0,
            myCheckOutIndex: 0
        },
        methods: {
            callSearch: function () {
                var Jsondata = { "t": this.t, "q": this.q, "f": this.f, "s": this.s, "p": this.p };
                var filter = JSON.stringify(Jsondata);
                $.post(this.requrl, filter, function (response) {
                    var result = JSON.parse(response);
                    var searchResultItem = JSON.parse(result.ass.SearchSettings[2].SearchResultItem);

                    var statisticResult = searchResultItem.StatisticResult;
                    vm.$data.statisticResultList = statisticResult;
                    console.log(statisticResult);
                    $.each(statisticResult[0].Mapping, function (index, item) {
                        switch (item.Value) {
                            case "Published":
                                vm.$data.publishedCount = item.Count;
                                break;
                            case "Expired":
                                vm.$data.expiredCount = item.Count;
                                break;
                            case "Deleted":
                                vm.$data.deletedCount = item.Count;
                                break;
                        }
                    });
                    vm.$data.statisticResultList.splice(0, 1);



                    var resultList = searchResultItem.ResultList;
                    $.each(resultList, function (index, item) {
                        if (item.State == "Published") {
                            vm.$data.dataPublishedResultList.push(item);
                        }
                        if (item.State == "Expired") {
                            vm.$data.dataExpiredResultList.push(item);
                        }
                        if (item.State == "Deleted") {
                            vm.$data.dataDeletedResultList.push(item);
                        }
                    });

                    $('#loadingModal').modal('hide');

                });
            },
            filterSearch: function (item) {
                var filter = "";
                var index = -1;
                for (var i = 0; i < vm.$data.filterList.length; i++) {
                    if (vm.$data.filterList[i].ESName == item.ESName && vm.$data.filterList[i].Value == item.Value) {
                        index = i;
                    }
                }

                if (index == -1) {
                    vm.$data.filterList.push(item);
                }
                else {
                    vm.$data.filterList.splice(index, 1);
                }

                var sortarr = vm.$data.filterList.sort(function (a, b) {
                    return a.ESName.localeCompare(b.ESName);
                });

                var map = [];
                var filter = "";
                for (var m = 0; m < sortarr.length; m++) {
                    if (map.indexOf(sortarr[m].ESName) > -1) {
                        filter += "__" + sortarr[m].Value;
                    }
                    else {
                        map.push(sortarr[m].ESName);
                        filter += "||" + sortarr[m].ESName + "__" + sortarr[m].Value;
                    }
                }

                vm.$data.dataPublishedResultList.length = 0;
                vm.$data.dataExpiredResultList.length = 0;
                vm.$data.dataDeletedResultList.length = 0;

                this.f = filter.replace('||', '');
                this.p = 1;
                vm.callSearch();
            },
            likeSearch: function () {
                vm.$data.q = this.searchKey;
                vm.$data.f = "";
                vm.$data.s = "";
                vm.$data.p = 1;

                vm.$data.dataPublishedResultList.length = 0;
                vm.$data.dataExpiredResultList.length = 0;
                vm.$data.dataDeletedResultList.length = 0;

                vm.callSearch();
            },
            recordEdit: function (item) {
                var urlEdit = item.NoNotesExternalSourceURL.replace('preview', 'edit');
                window.open(urlEdit, '_blank');
            },
            recordDelete: function (item) {
                var r = confirm("Are you sure you want to delete it?");
                if (r) {
                    var Jsondata = { "Token": "", "ActionCode": "", "EntityName": "Document", "StaffId": "System", "StaffName": "System", "CurrentUserRole": [], "ActionMessage": "Submit", "UpdateWorkflowArgs": false, "Items": null };
                    var ids = [item.SourceID];
                    Jsondata.DocIds = ids;
                    Jsondata.FieldsValue = { "C4-WorkflowStateDisplayName": "Deleted" };
                    var url = "https://appcnhkdm450.digitalmaker.asia.pwcinternal.com/pwccnhk/gtsventure/customapi/BatchUpdateDocs";
                    $.post(url, Jsondata, function (response) {
                        if (response.StatusCode == 200) {
                            window.location.href = window.location.href;
                        }
                    });
                }
            },
            showMoreFilter: function (DataType) {
                this.p += 1;
                vm.callSearch();
            },
            getMyCheckOut: function () {
                var url = "https://appcnhkdm450.digitalmaker.asia.pwcinternal.com/pwccnhk/gtsventure/customapi/RetrieveQueryDocs";
                var Jsondata = {};
                Jsondata.Token = "";
                Jsondata.EntityName = "q10z7uxi3ad";
                Jsondata.Size = 10;
                Jsondata.Index = this.myCheckOutIndex == 0 ? 0 : this.myCheckOutIndex * 10 - 1;
                var searchItem = [];
                searchItem.push({ Method: "And", Operator: "Equal", Name: "IsDeleted", Value: 0 });
                Jsondata.SearchItem = searchItem;
                Jsondata.Order = { "C4-ModifyDate": "Descending" };
                Jsondata.Columns = ["Title", "DocumentType", "C4-CreateDate", "C4-CreateBy"];
                $.post(url, Jsondata, function (response) {
                    console.log(response);
                    if (response.StatusCode == 200) {
                        vm.$data.myCheckOutCount = response.Data.total;
                        if (Jsondata.Index == 0) {
                            vm.$data.dataMyCheckoutList = response.Data.rows;
                        } else {
                            $.each(response.Data.rows, function (index, item) {
                                vm.$data.dataMyCheckoutList.push(item);
                            });
                        }
                    }
                });
            },
            showMoreCheckOut: function () {
                this.myCheckOutIndex += 1;
                vm.getMyCheckOut();
            },
            getDocumentIcon: function (type) {
                var url = "";
                switch (type.toLowerCase()) {
                    case "bmp":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=50495759-ebb8-417c-82c3-2a8ebaff0d1a";
                        break;
                    case "doc":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=15c2fd97-056e-4a1c-a783-00ed66548194";
                        break;
                    case "docx":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=05ac3efa-7988-4d0d-8837-2350ae7da275";
                        break;
                    case "gif":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=6b33b954-5d40-4b18-b402-4a02ce99b905";
                        break;
                    case "jpeg":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=68570012-373f-4066-a337-1396cea85dc1";
                        break;
                    case "jpg":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=cf34ce35-c4a0-4d98-9c0c-cefbbe727f24";
                        break;
                    case "pdf":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=c9dca41e-daa7-4877-9022-7c4070c83f22";
                        break;
                    case "ppt":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=f28a28e4-c5e8-4268-9c4b-cbebf051c02b";
                        break;
                    case "pptx":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=f31d224f-fa15-4925-abb2-087656ebb94b";
                        break;
                    case "psd":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=884bc4c5-2867-423f-8270-28b00947f780";
                        break;
                    case "tif":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=dc5a5367-2617-4283-90c8-af606faf5ac2";
                        break;
                    case "tiff":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=a7461cf3-1e6a-40f8-9c0f-f684468bf9e2";
                        break;
                    case "vsd":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=c4b72d21-f070-4514-9beb-5bd562bb1c5e";
                        break;
                    case "vsdx":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=11935fd5-93df-463d-bf80-70fb63d18ed7";
                        break;
                    case "xls":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=7f0e796b-55c7-45a5-b009-dc6730669c0c";
                        break;
                    case "xlsx":
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=88aa2de8-cdfd-464b-95a9-372d55841db4";
                        break;
                    default:
                        url = "/pwccnhk/gtsventure/Admin/HomePage/DownloadFile?fileIds=0b65a60c-6c6a-43a0-bab7-b5881dd97261";
                        break;
                }
                return url;
            },
            initLoadData: function () {
                $('#loadingModal').modal({ backdrop: 'static', keyboard: false });
                setTimeout(function () {
                    vm.getMyCheckOut();
                    vm.callSearch();
                }, 1000);
            }
        }
    });

    vm.initLoadData();

</script>         